﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Prototype_1
{
    public class Player
    {
        public Texture2D playerTexture;
        public Rectangle hitBox;
        public int Health;
        public int screenHeight;

        public Player(Texture2D playerTexture)
        {
            this.playerTexture = playerTexture;
            hitBox = new Rectangle(0, 0, playerTexture.Width, playerTexture.Height);
        }
        public Player(Texture2D playerTexture, Rectangle hitBox) {
            this.playerTexture = playerTexture;
            
            this.hitBox = hitBox;
        }

        public void Initialize()
        {
            Health = 101;
            screenHeight = 500;
        }

        public void Update()
        {
            if (Keyboard.GetState().IsKeyDown(Keys.Right))
                hitBox.X += 3;
            if (Keyboard.GetState().IsKeyDown(Keys.Left))
                hitBox.X -= 3;
            if (Keyboard.GetState().IsKeyDown(Keys.Up))
                hitBox.Y -= 3;
            if (Keyboard.GetState().IsKeyDown(Keys.Down))
                hitBox.Y += 3;

            if (hitBox.Y<= 0)
                hitBox.Y = 0;
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(playerTexture, hitBox, Color.White);
            
        }
    }
}